package com.lrz.controller;

import com.lrz.common.Result;
import com.lrz.common.StatusCode;
import com.lrz.pojo.Column;
import com.lrz.pojo.dto.ArticleDTO;
import com.lrz.service.ColumnService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/column")
@CrossOrigin
public class ColumnController {

    @Resource
    private ColumnService columnService;

    @GetMapping
    public Result findAll(){
        List<Column> list = columnService.findAll();
        return new Result(true, StatusCode.OK, "查询成功", list);
    }
}
